/*
 * general_View.java
 *
 * Created on 18 de mayo de 2008, 8:51
 */

package propres;

import javax.swing.plaf.metal.*;
import javax.swing.UIManager;


/**
 *
 * @author  neochange
 */
public class general_View extends javax.swing.JFrame {
    
    /** Creates new form general_View */
    public general_View() {
        try{
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
        }
        catch(Exception e){
        System.out.println("Error cargando L&F: "+e.getMessage());
        }
        initComponents();
        
     }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFrame1 = new javax.swing.JFrame();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jTabbedPane5 = new javax.swing.JTabbedPane();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jTabbedPane4 = new javax.swing.JTabbedPane();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jTabbedPane7 = new javax.swing.JTabbedPane();
        jTabbedPane6 = new javax.swing.JTabbedPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();

        jFrame1.setName("jFrame1"); // NOI18N

        javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(propres.PropresApp.class).getContext().getResourceMap(general_View.class);
        setTitle(resourceMap.getString("Proyecto Programacion: Restaurante.title")); // NOI18N
        setName("Proyecto Programacion: Restaurante"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jTabbedPane5.setName("jTabbedPane5"); // NOI18N
        jTabbedPane5.add(new Cliente_Viewfi2(CVc));
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane5.TabConstraints.tabTitle"), jTabbedPane5); // NOI18N

        jTabbedPane3.setName("jTabbedPane3"); // NOI18N
        jTabbedPane3.add(new alimento2_View2(CVA));
        jTabbedPane3.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                jTabbedPane3ComponentShown(evt);
            }
        });
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane3.TabConstraints.tabTitle"), jTabbedPane3); // NOI18N

        jTabbedPane4.setName("jTabbedPane4"); // NOI18N
        jTabbedPane4.add(new plato_Viewfi4(CVA,CVp));
        jTabbedPane4.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                jTabbedPane4ComponentShown(evt);
            }
        });
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane4.TabConstraints.tabTitle"), jTabbedPane4); // NOI18N

        jTabbedPane2.setName("jTabbedPane2"); // NOI18N
        jTabbedPane2.add(new dieta_Viewpes(CVc,CVA,CVpref,CVp));
        jTabbedPane2.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                jTabbedPane2ComponentShown(evt);
            }
        });
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane2.TabConstraints.tabTitle"), jTabbedPane2); // NOI18N

        jTabbedPane7.setName("jTabbedPane7"); // NOI18N
        jTabbedPane7.add(new Pagos_Viewfi(CVc));
        jTabbedPane7.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                jTabbedPane7ComponentShown(evt);
            }
        });
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane7.TabConstraints.tabTitle"), jTabbedPane7); // NOI18N

        jTabbedPane6.setName("jTabbedPane6"); // NOI18N
        jTabbedPane6.add(new preferencias_Viewfi(CVc));
        jTabbedPane6.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                jTabbedPane6ComponentShown(evt);
            }
        });
        jTabbedPane1.addTab(resourceMap.getString("jTabbedPane6.TabConstraints.tabTitle"), jTabbedPane6); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem2);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 620, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTabbedPane3ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jTabbedPane3ComponentShown
        // TODO add your handling code here:
        System.out.println("ENTRO EN VISTA ALIM");
        
        
    }//GEN-LAST:event_jTabbedPane3ComponentShown

    private void jTabbedPane4ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jTabbedPane4ComponentShown
        // TODO add your handling code here:
        System.out.println("ENTRO EN VISTA platos");
        
        jTabbedPane4.removeAll();
        jTabbedPane4.add(new plato_Viewfi4(CVA,CVp));
    }//GEN-LAST:event_jTabbedPane4ComponentShown

    private void jTabbedPane2ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jTabbedPane2ComponentShown
        // vista de dieta
        System.out.println("ENTRO EN VISTA dieta");
        
        jTabbedPane2.removeAll();
        jTabbedPane2.add(new dieta_Viewpes(CVc,CVA,CVpref,CVp));
        
    }//GEN-LAST:event_jTabbedPane2ComponentShown

    private void jTabbedPane6ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jTabbedPane6ComponentShown
        // Vista preferencias
        System.out.println("ENTRO EN VISTA preferencias");
        
        jTabbedPane6.removeAll();
        try{
        jTabbedPane6.add(new preferencias_Viewfi(CVc));
        }
        catch(Exception e){System.out.println(e.getMessage());}
    }//GEN-LAST:event_jTabbedPane6ComponentShown

    private void jTabbedPane7ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jTabbedPane7ComponentShown
        // Vista Pagos
        System.out.println("ENTRO EN VISTA Pagos");
        
        jTabbedPane7.removeAll();
        jTabbedPane7.add(new Pagos_Viewfi(CVc));
        
    }//GEN-LAST:event_jTabbedPane7ComponentShown

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // Salir del programa
        System.exit(0);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // Abrir about
        About_Viewfi2 O = new About_Viewfi2(jFrame1,false);
        O.setLocationRelativeTo(null);
        O.setVisible(true);
    }//GEN-LAST:event_jMenuItem2ActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new general_View().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFrame jFrame1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JTabbedPane jTabbedPane4;
    private javax.swing.JTabbedPane jTabbedPane5;
    private javax.swing.JTabbedPane jTabbedPane6;
    private javax.swing.JTabbedPane jTabbedPane7;
    // End of variables declaration//GEN-END:variables
 
    private CtrlVistaCliente CVc = new CtrlVistaCliente();
    private CtrlVistalimento CVA = new CtrlVistalimento(); 
    private CtrlVistaplato CVp = new CtrlVistaplato(CVA);
    private CtrlVistaPreferencias CVpref = new CtrlVistaPreferencias(CVc);
    private CtrlVistadieta CVd = new CtrlVistadieta(CVc,CVA,CVpref,CVp);
    private CtrlVistaPagos CVpagos = new CtrlVistaPagos(CVc);
    
    
}
